Skip to content

ci: request a Copilot review once CI first passes on a PR to main - #1016

Open
alongd wants to merge 1 commit into
mainfrom
copilot-review-on-green
Open

alongd wants to merge 1 commit into
mainfrom
copilot-review-on-green

Conversation

@alongd

@alongd alongd commented Aug 22, 2026

Copy link
Copy Markdown
Member

What

Adds .github/workflows/copilot-review.yml: the first time a PR to main passes CI, it requests a Copilot code review — once.

How

Listens on workflow_run for the CI workflow completing with conclusion == success on a pull_request, resolves the PR (event payload for same-repo PRs; head-SHA lookup for forks), and adds copilot-pull-request-reviewer[bot] as a reviewer. A dedup check (skip if Copilot is already requested or has already reviewed) keeps it to one pass per PR — it does not re-fire on later green pushes.

Why gated on green, not a ruleset

A copilot_code_review branch ruleset can only fire on PR open or on every push — it cannot wait for CI. Gating on green keeps Copilot off red branches and off the quota until the branch actually builds, and holds it to a single review.

Notes

  • Config-only: no change to ci.yml or any source/test.
  • The listener activates once this is on main; it takes effect on the next PR.
  • permissions: pull-requests: write, contents: read.

@codecov

codecov Bot commented Aug 22, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.21%. Comparing base (6520c82) to head (d1a8544).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1016      +/-   ##
==========================================
- Coverage   66.29%   66.21%   -0.09%     
==========================================
  Files         122      122              
  Lines       41825    41825              
  Branches    10749    10749              
==========================================
- Hits        27729    27693      -36     
- Misses      11053    11076      +23     
- Partials     3043     3056      +13     
Flag Coverage Δ
functionaltests 66.21% <ø> (-0.09%) ⬇️
unittests 66.21% <ø> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alongd
alongd force-pushed the copilot-review-on-green branch from 85a0c5d to 7b20a03 Compare August 23, 2026 05:17
@alongd
alongd requested a lite review from Copilot August 23, 2026 16:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a GitHub Actions workflow that waits for the repository’s existing CI workflow to complete successfully on a PR targeting main, then requests a Copilot code review exactly once per PR via a dedup check.

Changes:

  • Introduces a workflow_run listener gated on conclusion == success and event == pull_request.
  • Resolves the PR from the workflow_run payload (with a fork fallback) and requests copilot-pull-request-reviewer[bot].
  • Avoids repeat requests by skipping if Copilot is already requested or has already reviewed.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/copilot-review.yml
Comment thread .github/workflows/copilot-review.yml
@alongd
alongd force-pushed the copilot-review-on-green branch from 7b20a03 to 1f83571 Compare August 31, 2026 04:30
Adds .github/workflows/copilot-review.yml. It listens on workflow_run for the
"CI" workflow completing successfully and, for a PR targeting main, requests
a Copilot code review exactly once — the first time CI is green. A dedup check
(skip if Copilot is already a requested reviewer or has already reviewed) keeps
it to a single pass rather than re-firing on every subsequent green push.

Chosen over a copilot_code_review branch ruleset, which can only fire on PR open
or on every push and cannot gate on CI passing — so it would review red branches
and burn Copilot's premium-request quota on them.
@alongd
alongd force-pushed the copilot-review-on-green branch from 1f83571 to d1a8544 Compare September 26, 2026 19:01
kfir4444 added a commit that referenced this pull request Oct 4, 2026
…rift (#1066)

## What

Adds a `codecov.yml` (23 lines, no code change):

- `coverage.status.project.default.threshold: 1%`
- `coverage.status.patch.default.target: 80%`

## Why

ARC has no Codecov configuration at all — `.coveragerc` configures
coverage.py's *collection*, not
Codecov's *status checks*. With no config, Codecov falls back to its
built-in defaults, under which
the `project` status is `target: auto` with a **0% threshold**: total
coverage may never dip by any
amount relative to the base commit.

The consequence is that nearly every PR adding code covered below the
repository average (~67%)
reports a failing check while every test job, CodeQL and the functional
suite are green. Observed
on the current open set, all red on `codecov/project` alone:

| PR | status |
|---|---|
| #653 | `67.03% (-0.10%)` → `67.05% (-0.08%)` after adding a genuine
unit test |
| #860, #1016, #1039, #1050, #1054, #1055, #1056, #1057 | red on
`codecov/project`, everything else green |

On #653, `codecov/patch` simultaneously reported *"Coverage not
affected"* — the gate that actually
judges whether the PR's new code is tested was already satisfied. A
check that fails on
one-tenth of a percentage point trains reviewers to ignore it, which
costs us the patch signal too.

## What this does and does not change

- **Does:** lets total coverage drift up to 1% without failing the
status.
- **Does:** keep an explicit `patch` target, so the coverage of a PR's
own new or changed lines
remains a gating signal. This is the stricter half of the config, not a
loosening.
- **Does not:** touch any test or source file, change `.coveragerc`, or
alter what coverage is
  collected.
- **Does not:** raise ARC's actual coverage. That is a separate and much
larger piece of work.

Note that Codecov re-evaluates statuses on new uploads, so already-open
PRs will pick this up on
their next CI run rather than retroactively.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants